package com.ghy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.servlet.MultipartConfigElement;

@EnableWebMvc
@SpringBootApplication
public class GhyPositionApplication {

    public static void main(String[] args) {
        SpringApplication.run(GhyPositionApplication.class, args);
    }

    /**
     * 设置文件上传大小
     */

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize( DataSize.parse("2000MB"));
        factory.setMaxRequestSize(DataSize.parse("2000MB"));
        return factory.createMultipartConfig();
    }
}
